package com.mxpio.erp.common.workshop.entity;

import com.mxpioframework.jpa.annotation.DictAble;
import com.mxpioframework.security.annotation.Dict;
import com.mxpioframework.security.entity.User;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

@Data
@Entity
@Table(name = "v_mb_erp_purchase_odline_exec_detail")
@Schema(description="采购订单明细行执行情况详情")//
public class VPurchaseOrderLineExecDtail implements DictAble, Serializable {
	
	private static final long serialVersionUID = 1L;
	
	@Transient
	private Map<String, String> textMap;

	public String putText(String key, String value) {
		if (textMap == null) {
			textMap = new HashMap<>();
		}
		return textMap.put(key, value);
	}
	@Id
	@Column(name = "BIZ_NO_")
	@Schema(description = "业务单号")
	private String bizNo;

	@Column(name = "LINE_NO_", updatable = false)
	@Schema(description = "行号")
	@Id
	private String lineNo;

	@Column(name = "CREATE_YEARMON")
	@Schema(description = "年份")
	private String createYearmon;

	@Schema(description = "(建议)到货日期")
	@Column(name = "SUGGEST_ARRIVE_DATE_")
	private String suggestArriveDate;

	@Column(name = "last_time")
	@Schema(description = "最后执行时间")
	private String lastTime;

	@Column(name = "delay_cnt")
	@Schema(description = "延期数")
	private BigDecimal delayCnt;

	@Column(name = "delay_days")
	@Schema(description = "延期天数")
	private BigDecimal delayDays;

	@Column(name = "ITEM_CODE_")
	@Schema(description = "物料代码")
	private String itemCode;

	@Column(name = "ITEM_NAME_")
	@Schema(description = "物料名称")
	private String itemName ;

	@Column(name = "BIZ_MAN_")
	@Schema(description = "业务员")
	@Dict(dicCode = "username",dicEntity = User.class,dicText = "nickname")
	private String bizMan ;

	@Column(name = "QUANTITY_")
	@Schema(description = "需求数量")
	private BigDecimal quantity;

	@Column(name = "EXEC_QUANTITY_")
	@Schema(description = "入库数量")
	private BigDecimal execQuantity;
}
